/*
 * @Author: 刘岩 15136056318@163.com
 * @Date: 2023-08-04 09:13:04
 * @LastEditors: 刘岩 15136056318@163.com
 * @LastEditTime: 2023-09-09 21:25:25
 * @FilePath: /yik-ui-pnpm/yik-ui/vite.config.js
 * @Description:
 */
import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
// https://vitejs.dev/config/
export default defineConfig({
  server: {
    port: 5000,
    host: "0.0.0.0",
  },
  build: {
    //打包后文件目录
    outDir: "es",
    //压缩
    minify: true,
    rollupOptions: {
      //忽略打包vue文件
      external: ["vue"],
      //input: ["index.ts"],
      output: {
        globals: {
          vue: "Vue",
        },
        dir: "dist",
      },
    },
    lib: {
      entry: "./build/index.js",
      name: "yik-ui",
      fileName: "yik-ui",
      formats: ["es", "umd", "cjs"],
    },
  },
  plugins: [vue()],
});
